<template>
  <div class="headerSearch">
    <div class="leftContainer">
        <slot name="left"></slot>
    </div>
    <div class="searchBtn" @click="toSearch">
      <van-icon class="searchIcon" name="search" />
      <div class="searchText">搜索商品, 共137321款好物</div>
    </div>
    <div>
        <slot name="right"></slot>
    </div>
  </div>
</template>

<script lang="ts">
  export default {
    
  }
</script>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
const router=useRouter()
//跳转到搜索页
const toSearch = () => {
  router.push('/search')
}
</script>


<style lang="less">
.headerSearch{
  display: flex;
  // width: 100%;
  height: 44px;
  justify-content: space-between;
  // background-color: red;
  align-items: center;
  margin: 0 15px;
  .leftContainer{
    font-size: 16px;
  }
  .searchBtn{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    background-color: #EDEDED;
    margin:15px;
    border-radius: 5px;
    .searchIcon{
      font-size: 18px;
      margin-right: 5px;
    }
    .searchText{
      font-size: 14px;
    }
  }

}
</style>